<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>事件</title>
    <style>
		  body {
			  min-width: 300px;
				min-height: 300px;
				background: gray;
			}
    </style>
  </head>
  <body onclick="clickBody()">
	  <button id="btn">click</button>
  </body>
	<script>
	  function clickBody() {
			console.log('click body')
		}
	  function clickBtn() {
			console.log('click button')
		}

		document.getElementById('btn').addEventListener('click', function(e){
		  //e.preventDefault();
			//e.stopPropagation(); // 这句话才是有效的
		  // stopPropagation IE9+行的通, IE8-则需要使用非标准的cancelBubble
			clickBtn();
		})

		window.onstorage = function(e) {
		  console.log(e)
		}
	</script>
</html>
